import 'package:flutter/material.dart';

class MyPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return Page();
  }
}
class Page extends State<MyPage>{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return layout(context);
  }
  Widget layout(BuildContext context){
    return Scaffold(
//      appBar: buildAppBar(context),
      body:
      CustomScrollView(
        controller: null,
        slivers: <Widget>[
          SliverAppBar(
            title: Text('我的'),
            centerTitle: true,
            primary: true,
            floating: true,
            pinned: true,
            backgroundColor: Theme.of(context).accentColor,
            expandedHeight: 200.0,
            flexibleSpace: FlexibleSpaceBar(
              background: Image.asset('images/home/icon_category.png', fit: BoxFit.cover),
            ),
          ),
          SliverList(delegate: SliverChildBuilderDelegate((BuildContext context,int index){
            return getImageFromNet('http://i2.yeyou.itc.cn/2014/huoying/hd_20140925/hyimage07.jpg');
          },childCount: 10)),
        ],
      ),
    );
  }
  Widget buildAppBar(BuildContext context){
    return AppBar(title: Text('我的'));
  }
  Widget getImageFromNet(url){
    return Image.network(url);
  }
}